package design.demos.order.service;

import design.demos.order.bo.Order;

import java.util.HashMap;
import java.util.Map;

public class OrderDataBaseService {
    static Map<String, Order> orderMap = new HashMap<>();
    public Order getOrderById(String id) {
        return orderMap.get(id);
    }

    public boolean addOrder(Order order){
        orderMap.put(order.getId(), order);
        return true;
    }

    public boolean updateOrder(Order order){
        orderMap.put(order.getId(), order);
        return true;
    }
}
